-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complementary areas use isActiveByDefault prop and local storage to determine whether is active or not #22381
Complementary areas use isActiveByDefault prop and local storage to determine whether is active or not #22381
Conversation
|
||
const { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill( | ||
'EditSiteSidebarInspector' | ||
); | ||
|
||
const BLOCK_INSPECTOR_ACTIVE_BY_DEFAULT = Platform.select( { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this default value different between native and web or between web and web mobile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is between native and web. We had a /packages/interface/src/store/defaults.native.js file specifying the default for native is to contain no open sidebars.
Size Change: -168 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
7e614ab
to
2514ce3
Compare
This PR was rebased and should be ready for a final look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jorge
Description
This PR removes static defaults setting which complementary areas are active (sidebars). Instead of static defaults, it proposes a flag "isActiveByDefault" that, when true, makes a complementary area active by default on the first-page load. On follow up page loads, the setting is retrieved from local storage.
cc: @youknowriad, @gziolo
How has this been tested?
I used
window.localStorage.clear();
to clean the local storage.I verified on edit-post and edit-site the default state of sidebars is kept as before.
I changed sidebars and verified their state is still persisted across page loads.